<div class="weekwork">
    <div class="yearworkwrap" *ngIf="showPage1">
        <ng-container [ngSwitch]="userType">
            <ng-container *ngSwitchCase="'gq'">
                <app-weekwork-table [inputParam]="inputParam.gqbz" [user]="{userType:userType,tab:'gqbz'}"
                    [bmList]="bmList" (dbclick)="trDbclick($event)"></app-weekwork-table>
            </ng-container>
            <ng-container *ngSwitchDefault>
                <nz-tabset [(nzSelectedIndex)]="tabIndex" (nzSelectChange)="tabSelectChange($event)">
                    <!-- <nz-tab nzTitle="编制">
                        <app-weekwork-table [inputParam]="inputParam.cjbz" [user]="{userType:userType,tab:'cjbz'}"
                            (dbclick)="trDbclick($event)">
                        </app-weekwork-table>
                    </nz-tab>
                    <nz-tab nzTitle="审批">
                        <app-weekwork-table [inputParam]="inputParam.gqsp" [user]="{userType:userType,tab:'gqsp'}"
                            (dbclick)="trDbclick($event)">
                        </app-weekwork-table>
                    </nz-tab> -->
                    <nz-tab [nzTitle]="tab.title" *ngFor="let tab of tabCfg[userType];let i = index;">
                        <!-- <app-weekwork-table [inputParam]="inputParam[tab.id]" [user]="{userType:userType,tab:tab.id}"
                            (dbclick)="trDbclick($event)">
                        </app-weekwork-table> -->
                        <ng-container *ngIf="showCjlist; else temp_gqweekWork">
                            <ng-container *ngTemplateOutlet="cjListTable"></ng-container>
                        </ng-container>
                        <ng-template #temp_gqweekWork>
                            <app-weekwork-table [inputParam]="inputParam[tab.id]" [bmList]="bmList"
                                [user]="{userType:userType,tab:tab.id}" (dbclick)="trDbclick($event)">
                                <button *ngIf="tab.id==='gqck'" nz-button nzType="primary" (click)="showCj()">
                                    <i nz-icon nzType="arrow-left"></i>
                                    返回</button>
                            </app-weekwork-table>
                        </ng-template>
                    </nz-tab>
                </nz-tabset>
            </ng-container>
            <!-- <ng-container *ngSwitchCase="'gcs'">
                <nz-tabset [(nzSelectedIndex)]="tabIndex" (nzSelectChange)="tabSelectChange($event)">
                    <nz-tab nzTitle="编制">
                        <app-weekwork-table [inputParam]="inputParam.jskbz" [user]="{userType:userType,tab:'jskbz'}"
                            (dbclick)="trDbclick($event)">
                        </app-weekwork-table>
                    </nz-tab>
                    <nz-tab nzTitle="车间审批">
                        <app-weekwork-table [inputParam]="inputParam.cjsp" [user]="{userType:userType,tab:'cjsp'}"
                            (dbclick)="trDbclick($event)">
                        </app-weekwork-table>
                    </nz-tab>
                    <nz-tab nzTitle="车间查看">
                        <app-weekwork-table [inputParam]="inputParam.cjck" [user]="{userType:userType,tab:'cjck'}"
                            (dbclick)="trDbclick($event)">
                        </app-weekwork-table>
                    </nz-tab>
                    <nz-tab nzTitle="工区查看">
                        <ng-container *ngIf="showCjlist; else temp_gqMonthWork">
                            <ng-container *ngTemplateOutlet="cjListTable"></ng-container>
                        </ng-container>
                        <ng-template #temp_gqMonthWork>
                            <app-weekwork-table [inputParam]="inputParam.gqck" [user]="{userType:userType,tab:'gqck'}"
                                (dbclick)="trDbclick($event)">
                                <button nz-button nzType="primary" (click)="showCj()">
                                    <i nz-icon nzType="arrow-left"></i>
                                    返回</button>
                            </app-weekwork-table>
                        </ng-template>
                    </nz-tab>
                </nz-tabset>
            </ng-container>
            <ng-container *ngSwitchCase="'jskz'">
                <nz-tabset [(nzSelectedIndex)]="tabIndex" (nzSelectChange)="tabSelectChange($event)">
                    <nz-tab nzTitle="技术科审批">
                        <app-weekwork-table [inputParam]="inputParam.jsksp" [user]="{userType:userType,tab:'jsksp'}"
                            (dbclick)="trDbclick($event)">
                        </app-weekwork-table>
                    </nz-tab>
                    <nz-tab nzTitle="技术科查看">
                        <app-weekwork-table [inputParam]="inputParam.jskck" [user]="{userType:userType,tab:'jskck'}"
                            (dbclick)="trDbclick($event)">
                        </app-weekwork-table>
                    </nz-tab>
                    <nz-tab nzTitle="车间查看">
                        <app-weekwork-table [inputParam]="inputParam.cjck" [user]="{userType:userType,tab:'cjck'}"
                            (dbclick)="trDbclick($event)">
                        </app-weekwork-table>
                    </nz-tab>
                    <nz-tab nzTitle="工区查看">
                        <ng-container *ngIf="showCjlist; else temp_gqMonthWork">
                            <ng-container *ngTemplateOutlet="cjListTable"></ng-container>
                        </ng-container>
                        <ng-template #temp_gqMonthWork>
                            <app-weekwork-table [inputParam]="inputParam.gqck" [user]="{userType:userType,tab:'gqck'}"
                                (dbclick)="trDbclick($event)">
                                <button nz-button nzType="primary" (click)="showCj()">
                                    <i nz-icon nzType="arrow-left"></i>
                                    返回</button>
                            </app-weekwork-table>
                        </ng-template>
                    </nz-tab>
                </nz-tabset>
            </ng-container>
            <ng-container *ngSwitchCase="'dz'">
                <nz-tabset [(nzSelectedIndex)]="tabIndex" (nzSelectChange)="tabSelectChange($event)">
                    <nz-tab nzTitle="技术科审批">
                        <app-weekwork-table [inputParam]="inputParam.jsksp" [user]="{userType:userType,tab:'jsksp'}"
                            (dbclick)="trDbclick($event)">
                        </app-weekwork-table>
                    </nz-tab>
                    <nz-tab nzTitle="技术科查看">
                        <app-weekwork-table [inputParam]="inputParam.jskck" [user]="{userType:userType,tab:'jskck'}"
                            (dbclick)="trDbclick($event)">
                        </app-weekwork-table>
                    </nz-tab>
                    <nz-tab nzTitle="车间查看">
                        <app-weekwork-table [inputParam]="inputParam.cjck" [user]="{userType:userType,tab:'cjck'}"
                            (dbclick)="trDbclick($event)">
                        </app-weekwork-table>
                    </nz-tab>
                    <nz-tab nzTitle="工区查看">
                        <ng-container *ngIf="showCjlist; else temp_gqMonthWork">
                            <ng-container *ngTemplateOutlet="cjListTable"></ng-container>
                        </ng-container>
                        <ng-template #temp_gqMonthWork>
                            <app-weekwork-table [inputParam]="inputParam.gqck" [user]="{userType:userType,tab:'gqck'}"
                                (dbclick)="trDbclick($event)">
                                <button nz-button nzType="primary" (click)="showCj()">
                                    <i nz-icon nzType="arrow-left"></i>
                                    返回</button>
                            </app-weekwork-table>
                        </ng-template>
                    </nz-tab>
                </nz-tabset>
            </ng-container> -->

        </ng-container>

    </div>

    <div *ngIf="showPage2">
        <app-weekwork-detail [inputParam]="page2Param">
            <button nz-button nzType="primary" (click)="showPage(1)">
                <i nz-icon nzType="arrow-left"></i>返回</button>
        </app-weekwork-detail>
    </div>

    <ng-template #cjListTable>
        <nz-table #cjTable nzSize="small" [nzScroll]="lockHeadScroll" [nzLoadingDelay]="1000" [nzShowPagination]="false" [nzFrontPagination]="false"
            [nzData]="cjList" nzBordered>
            <thead>
                <tr>
                    <th nzWidth="100px" nzAlign="center">序号</th>
                    <th nzAlign="center">部门</th>
                </tr>
            </thead>
            <tbody>
                <tr *ngFor="let data of cjTable.data;let i = index" (dblclick)="cjDbclick(data)" nz-tooltip
                    nzTooltipTitle="双击查看详情" nzTooltipPlacement="bottom" style="cursor:pointer">
                    <td nzAlign="center">{{+i+1}}</td>
                    <td nzAlign="center">{{data.opName}}</td>
                </tr>
            </tbody>
        </nz-table>
    </ng-template>

</div>